<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: header"></head>
<title>FCRE2.1--我的任务</title>
<body class="gray-bg">
<div id="bver" style="background-color: #FFEB3B;text-align: center;line-height: 80px;font-size:18px;color:#f00;">
	您正在使用<b>【IE浏览器】</b>或者其它浏览器的<b>【兼容模式】</b><img src="/assets/img/ie.png">，不能正常使用本系统的功能，建议切换到【极速模式】<img src="/assets/img/jisu.png">或更换浏览器。<br>推荐使用<a href='http://chrome.360.cn/'>360极速浏览器</a><img src="/assets/img/360jisu.png">的【极速模式】。
</div>
<div class="container-fluid">
	<div id="mynav" class="row-fluid">
		<div class="span12">
			<div class="navbar navbar-fixed-top" style="position: fixed;margin-bottom: 0;">
				<div class="navbar-inner">
					<div class="container-fluid">
					<div >
						<ul class="nav navbar-top-links navbar-right welcome-message">
	                    <li>
	                        <span class="text-muted">
	                        <th:block th:include="common :: datetime(${now0})" />
	                        </span>
	                    </li>
							<li>
								<a ><i class="fa fa-user"></i>[[${user.userName}]]</a>
							</li>
							<li>
								<th:block th:if="${#strings.contains(user.roleIds,',2,')} or ${#strings.contains(user.roleIds,',1,')}">
									<a th:href="'javascript:joinkc()'" class="fa fa-camera" > 监考</a>
								</th:block>
							</li>
	                    <li><a id="backtotop"><i class="fa fa-refresh"></i>刷新</a></li>
                    	<li><a id="logout"><i class="fa fa-sign-out"></i>退出</a></li>
						</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="row animated fadeInRight" style="margin-top: 60px;">
        <div class="ibox float-e-margins">
            <div id="ibox-content">
                 <div id="vertical-timeline" class="vertical-container light-timeline">
                     <div class="vertical-timeline-block" th:each="mytask: ${mytasklist}">
                         <div class="vertical-timeline-icon navy-bg">
                             <i class="fa fa-flag"></i>
                         </div>

                         <div class="vertical-timeline-content">
                         	<h4>
                         		<span class="label label-default" >任务编号</span><span class="label label-warning" th:text="${mytask.ksid}"></span>
                         	</h4>
                         	<h4>
		                         <span class="label label-default" >时间区间</span><span class="label label-success">[[${#dates.format(mytask.starttime,'yyyy/MM/dd HH:mm')}]]</span>--<span class="label label-danger">[[${#dates.format(mytask.endtime,'yyyy/MM/dd HH:mm')}]]</span>
		                     </h4>
		                     <div class="panel panel-primary">
				            <div class="panel-heading">
				              <h3 class="panel-title" th:text="${mytask.name}"></h3>
				            </div>
				            <div class="panel-body">
				              [[${mytask.intro}]]
				              <th:block th:switch="${mytask.status}" ><!--th:if="${#strings.contains(user.roleIds,',5,')}"-->
				               	<a th:case="0" href="#" class="btn btn-sm btn-warning" style="margin-left:10px;margin-right:10px;"> 未开始</a>
				               	<a th:case="1" th:href="'javascript:join(\''+${mytask.entryurl}+'\',\''+${mytask.ksid}+'\')'" class="btn btn-sm btn-primary" style="margin-left:10px;margin-right:10px;"> 进入</a>
				               	<a th:case="2" href="#" class="btn btn-sm btn-success" style="margin-left:10px;margin-right:10px;"> 完成</a>
				               	<a th:case="3" href="#" class="btn btn-sm btn-danger" style="margin-left:10px;margin-right:10px;"> 未完成</a>
				               </th:block>
				               <!--<th:block th:if="${#strings.contains(user.roleIds,',4,')}">
				               		<a th:href="'javascript:joinkc(\''+${mytask.ksid}+'\')'" class="btn btn-sm btn-primary" style="margin-left:10px;margin-right:10px;"> 监考</a>
				               </th:block>-->
				            </div>
				          </div>
                         </div>
                     </div>
                 </div>
            </div>
        </div>          
</div>

    <div th:include="include :: footer"></div>
    <script th:src="@{/assets/js/timecountdown.min.js}"></script>
<script src="../static/assets/js/ckobject.js" th:src="@{/assets/js/ckobject.js}"></script>
    <script>
    var now0=Date.parse("[[${now0}]]".replace(/-/g,"/"));
    $(function(){
			bver=(CKobject.Platform()+' '+CKobject.browser()['B']+' v'+CKobject.browser()['V']);
			if(bver.indexOf("IE v") >0) {
				$("#bver").show();
				$(".signinpanel").hide();
			}	else {
				$("#bver").hide();
				xcsoft.counter("[[${now0}]]",function (time) {
					document.getElementById("y4").innerHTML=time.year
					document.getElementById("m4").innerHTML=time.monthZero
					document.getElementById("d4").innerHTML=time.dayZero
					document.getElementById("h4").innerHTML=time.hourZero
					document.getElementById("i4").innerHTML=time.minuteZero
					document.getElementById("s4").innerHTML=time.secondZero
				});
			}
    })
    </script>
    <script th:inline="javascript">

function joinkc(){
	window.location.href="/exam/exarrange/kcmgr";//+ksid;
}
function join(url,ksid){
	$.modal.loading("正在加载数据，请稍后...");
	$.ajax({
		type: "POST",
		url: "/" + url,
		data:{id:ksid},
		dataType: "json",
		success: function(ret){
			$.modal.closeLoading();
			if(ret.code == 0){
				top.location.href="/"+ret.msg+ksid;
			}else{
				$.modal.alertWarning(ret.msg);
			}
		},
		error:function(ret){
			$.modal.closeLoading();
			$.modal.alertWarning(ret.msg);
		}
	});	
}

</script>
<!-- <style>
#backtotop {
     width: 24px;
     color: white;
     padding: 12px 0px 12px 5px;
     position: fixed;
     top: 10px;
     right: 0px;
     cursor: pointer;
     text-align: center;
     z-index: 20;
     background-color: rgba(0, 188, 212, 0.65);
     border-radius: 12px 0px 0px 12px;
}
.logout{top:80px;
width: 24px;
     color: white;
     padding: 12px 0px 12px 5px;
     position: fixed;

     right: 0px;
     cursor: pointer;
     text-align: center;
     z-index: 20;
     background-color: rgba(255, 19, 8, 0.78);
     border-radius: 12px 0px 0px 12px;}
</style>
<div id="backtotop" style="right: 0px;">刷新</div>
<div id="logout" class="logout" style="right: 0px;">退出</div> -->
<script>
$(function(){
	$('#backtotop').click(function(){
		window.location.reload();
	});
	$('#logout').click(function(){
		window.location.href="/login/kdlogout";
	})
})
</script>
</body>
</html>
